﻿using System.Reflection;
using StructureMap;

namespace StreetPacMan.Server.Infra
{
    public static class Bootstrapper
    {
        public static void Bootstrap(params Assembly[] extraLoadedAssemblies)
        {
            ObjectFactory.Initialize(
                x => x.Scan(y =>
                                {
                                    foreach (var extraLoadedAssembly in extraLoadedAssemblies)
                                    {
                                        y.Assembly(extraLoadedAssembly);
                                    }
                                    y.TheCallingAssembly();
                                    y.WithDefaultConventions();
                                }));
        }
    }
}